import {
    list,
    saveSysParams,
    getSysParamsById,
    enabledControl
} from '@/services/settings/sysParams/sysParamsService';

export default {
    namespace: 'sysParamsModel',

    state: {},

    effects: {
        *list({payload, callback}, {call, put}) {
            const response = yield call(list, payload);
            if (callback) callback(response);
        },
        *saveSysParams({payload, callback}, {call, put}) {
            const response = yield call(saveSysParams, payload);
            if (callback) callback(response);
        },
        *getSysParamsById({payload, callback}, {call, put}) {
            const response = yield call(getSysParamsById, payload);
            if (callback) callback(response);
        },
        *enabledControl({ payload, callback }, { call, put }) {
            const response = yield call(enabledControl, payload);
            if(callback) callback(response);
        }
    },

    reducers: {},
};
